home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Tele
/
C
/
Comet2.1.3.cpt
/
azInclude
/
quickdraw.h
< prev
next >
Wrap
Text File
|
1991-07-10
|
14KB
|
473 lines
/* Copyright (C) 1984 by Manx Software Systems, Inc. */
#ifndef _QUICKDRAW
#ifndef _TYPES
#include <types.h>
#endif
/*
* QuickDraw data structures and function definitions.
*/
#define srcCopy 0
#define srcOr 1
#define srcXor 2
#define srcBic 3
#ifndef SMALL_MEM
#define notSrcCopy 4
#define notSrcOr 5
#define notSrcXor 6
#define notSrcBic 7
#endif
#define patCopy 8
#define patOr 9
#define patXor 10
#define patBic 11
#ifndef SMALL_MEM
#define notPatCopy 12
#define notPatOr 13
#define notPatXor 14
#define notPatBic 15
#define normalBit 0
#define inverseBit 1
#define redBit 4
#define greenBit 3
#define blueBit 2
#define cyanBit 8
#define magentaBit 7
#define yellowBit 6
#define blackBit 5
#define blackColor 33
#define whiteColor 30
#define redColor 205
#define greenColor 341
#define blueColor 409
#define cyanColor 273
#define magentaColor 137
#define yellowColor 69
#define picLParen 0
#define picRParen 1
#endif
typedef char QDByte;
typedef QDByte * QDPtr;
typedef QDPtr * QDHandle;
typedef unsigned char Pattern[8];
typedef int Bits16[16];
#define frameMode 0
#define paintMode 1
#define eraseMode 2
#define invertMode 3
#define fillMode 4
typedef unsigned char Style;
#define boldStyle 0x01
#define italicStyle 0x02
#define underlineStyle 0x04
#define outlineStyle 0x08
#define shadowStyle 0x10
#define condenseStyle 0x20
#define extendStyle 0x40
struct FontInfo {
short ascent;
short descent;
short widMax;
short leading;
};
typedef struct FontInfo FontInfo;
struct Point {
short v;
short h;
};
typedef struct Point Point;
#define vh(x) ((int *)(&(x).v))
struct Rect {
short top;
short left;
short bottom;
short right;
};
typedef struct Rect Rect;
#define topLeft(x) (*(struct Point *)(&(x).top))
#define botRight(x) (*(struct Point *)(&(x).bottom))
struct BitMap {
QDPtr baseAddr;
short rowBytes;
Rect bounds;
};
typedef struct BitMap BitMap;
struct Cursor {
Bits16 data;
Bits16 mask;
Point hotSpot;
};
typedef struct Cursor Cursor;
struct PenState {
Point pnLoc;
Point pnSize;
short pnMode;
Pattern pnPat;
};
typedef struct PenState PenState;
struct Region {
short rgnSize;
Rect rgnBBox;
};
typedef struct Region Region;
typedef struct Region * RgnPtr;
typedef struct Region ** RgnHandle;
#ifndef SMALL_MEM
struct Picture {
short picSize;
Rect picFrame;
};
typedef struct Picture Picture;
#endif
typedef struct Picture * PicPtr;
typedef struct Picture ** PicHandle;
#ifndef SMALL_MEM
struct Polygon {
short polySize;
Rect polyBBox;
Point polyPoints[1];
};
typedef struct Polygon Polygon;
typedef struct Polygon * PolyPtr;
typedef struct Polygon ** PolyHandle;
struct QDProcs {
QDPtr textProc;
QDPtr lineProc;
QDPtr rectProc;
QDPtr rRectProc;
QDPtr ovalProc;
QDPtr arcProc;
QDPtr polyProc;
QDPtr rgnProc;
QDPtr bitsProc;
QDPtr commentProc;
QDPtr txMeasProc;
QDPtr getPicProc;
QDPtr putPicProc;
};
typedef struct QDProcs QDProcs;
typedef struct QDProcs * QDProcsPtr;
#endif
struct GrafPort {
short device;
BitMap portBits;
Rect portRect;
RgnHandle visRgn;
RgnHandle clipRgn;
Pattern bkPat;
Pattern fillPat;
Point pnLoc;
Point pnSize;
short pnMode;
Pattern pnPat;
short pnVis;
short txFont;
Style txFace;
short txMode;
short txSize;
long spExtra;
long fgColor;
long bkColor;
short colorBit;
short patStretch;
QDHandle picSave;
QDHandle rgnSave;
QDHandle polySave;
#ifndef SMALL_MEM
QDProcsPtr grafProcs;
#else
Ptr grafProcs;
#endif
};
typedef struct GrafPort GrafPort;
typedef struct GrafPort * GrafPtr;
#ifndef _DRIVER
extern GrafPtr thePort;
extern Pattern white;
extern Pattern black;
extern Pattern gray;
extern Pattern ltGray;
extern Pattern dkGray;
extern Cursor arrow;
extern BitMap screenBits;
extern long randSeed;
#endif
pascal void InitGraf() = 0xa86e;
pascal void OpenPort() = 0xa86f;
pascal void InitPort() = 0xa86d;
pascal void ClosePort() = 0xa87d;
pascal void SetPort() = 0xa873;
pascal void GetPort() = 0xa874;
pascal void GrafDevice() = 0xa872;
pascal void SetPortBits() = 0xa875;
pascal void PortSize() = 0xa876;
pascal void MovePortTo() = 0xa877;
pascal void SetOrigin() = 0xa878;
pascal void SetClip() = 0xa879;
pascal void GetClip() = 0xa87a;
pascal void ClipRect() = 0xa87b;
pascal void BackPat() = 0xa87c;
pascal void InitCursor() = 0xa850;
pascal void SetCursor() = 0xa851;
pascal void HideCursor() = 0xa852;
pascal void ShowCursor() = 0xa853;
pascal void ObscureCursor() = 0xa856;
pascal void HidePen() = 0xa896;
pascal void ShowPen() = 0xa897;
pascal void GetPen() = 0xa89a;
pascal void GetPenState() = 0xa898;
pascal void SetPenState() = 0xa899;
pascal void PenSize() = 0xa89b;
pascal void PenMode() = 0xa89c;
pascal void PenPat() = 0xa89d;
pascal void PenNormal() = 0xa89e;
pascal void MoveTo() = 0xa893;
pascal void Move() = 0xa894;
pascal void LineTo() = 0xa891;
pascal void Line() = 0xa892;
pascal void TextFont() = 0xa887;
pascal void TextFace() = 0xa888;
pascal void TextMode() = 0xa889;
pascal void TextSize() = 0xa88a;
pascal void SpaceExtra() = 0xa88e;
pascal void DrawChar() = 0xa883;
pascal void DrawString() = 0xa884;
pascal void DrawText() = 0xa885;
pascal short CharWidth() = 0xa88d;
pascal short StringWidth() = 0xa88c;
pascal short TextWidth() = 0xa886;
pascal void GetFontInfo() = 0xa88b;
pascal void SetRect() = 0xa8a7;
pascal void OffsetRect() = 0xa8a8;
pascal void InsetRect() = 0xa8a9;
pascal Boolean SectRect() = 0xa8aa;
pascal void UnionRect() = 0xa8ab;
pascal Boolean PtInRect() = 0xa8ad;
pascal void Pt2Rect() = 0xa8ac;
pascal void PtToAngle() = 0xa8c3;
pascal Boolean EqualRect() = 0xa8a6;
pascal Boolean EmptyRect() = 0xa8ae;
pascal void FrameRect() = 0xa8a1;
pascal void PaintRect() = 0xa8a2;
pascal void EraseRect() = 0xa8a3;
pascal void InvertRect() = 0xa8a4;
pascal void FillRect() = 0xa8a5;
pascal void FrameRoundRect() = 0xa8b0;
pascal void PaintRoundRect() = 0xa8b1;
pascal void EraseRoundRect() = 0xa8b2;
pascal void InvertRoundRect() = 0xa8b3;
pascal void FillRoundRect() = 0xa8b4;
pascal RgnHandle NewRgn() = 0xa8d8;
pascal void DisposeRgn() = 0xa8d9;
pascal void CopyRgn() = 0xa8dc;
pascal void SetEmptyRgn() = 0xa8dd;
pascal void SetRectRgn() = 0xa8de;
pascal void RectRgn() = 0xa8df;
pascal void OpenRgn() = 0xa8da;
pascal void CloseRgn() = 0xa8db;
pascal void OffsetRgn() = 0xa8e0;
pascal void InsetRgn() = 0xa8e1;
pascal void SectRgn() = 0xa8e4;
pascal void UnionRgn() = 0xa8e5;
pascal void DiffRgn() = 0xa8e6;
pascal void XorRgn() = 0xa8e7;
pascal Boolean PtInRgn() = 0xa8e8;
pascal Boolean RectInRgn() = 0xa8e9;
pascal Boolean EqualRgn() = 0xa8e3;
pascal Boolean EmptyRgn() = 0xa8e2;
pascal void FrameRgn() = 0xa8d2;
pascal void PaintRgn() = 0xa8d3;
pascal void EraseRgn() = 0xa8d4;
pascal void InvertRgn() = 0xa8d5;
pascal void FillRgn() = 0xa8d6;
pascal void ScrollRect() = 0xa8ef;
pascal void CopyBits() = 0xa8ec;
pascal void AddPt() = 0xa87e;
pascal void SubPt() = 0xa87f;
pascal void SetPt() = 0xa880;
pascal Boolean EqualPt() = 0xa881;
pascal void LocalToGlobal() = 0xa870;
pascal void GlobalToLocal() = 0xa871;
pascal short Random() = 0xa861;
pascal Boolean GetPixel() = 0xa865;
pascal void StuffHex() = 0xa866;
pascal void ScalePt() = 0xa8f8;
pascal void MapPt() = 0xa8f9;
pascal void MapRect() = 0xa8fa;
pascal void MapRgn() = 0xa8fb;
#ifndef SMALL_MEM
pascal PicHandle OpenPicture() = 0xa8f3;
pascal void PicComment() = 0xa8f2;
pascal void ClosePicture() = 0xa8f4;
pascal void DrawPicture() = 0xa8f6;
pascal void KillPicture() = 0xa8f5;
pascal PolyHandle OpenPoly() = 0xa8cb;
pascal void ClosePoly() = 0xa8cc;
pascal void KillPoly() = 0xa8cd;
pascal void OffsetPoly() = 0xa8ce;
pascal void FramePoly() = 0xa8c6;
pascal void PaintPoly() = 0xa8c7;
pascal void ErasePoly() = 0xa8c8;
pascal void InvertPoly() = 0xa8c9;
pascal void FillPoly() = 0xa8ca;
pascal void MapPoly() = 0xa8fc;
pascal void SetStdProcs() = 0xa8ea;
pascal void StdText() = 0xa882;
pascal void StdLine() = 0xa890;
pascal void StdRect() = 0xa8a0;
pascal void StdRRect() = 0xa8af;
pascal void StdOval() = 0xa8b6;
pascal void StdArc() = 0xa8bd;
pascal void StdPoly() = 0xa8c5;
pascal void StdRgn() = 0xa8d1;
pascal void StdBits() = 0xa8eb;
pascal void StdComment() = 0xa8f1;
pascal short StdTxMeas() = 0xa8ed;
pascal void StdGetPic() = 0xa8ee;
pascal void StdPutPic() = 0xa8f0;
pascal void ForeColor() = 0xa862;
pascal void BackColor() = 0xa863;
pascal void ColorBit() = 0xa864;
pascal void FrameOval() = 0xa8b7;
pascal void PaintOval() = 0xa8b8;
pascal void EraseOval() = 0xa8b9;
pascal void InvertOval() = 0xa8ba;
pascal void FillOval() = 0xa8bb;
pascal void FrameArc() = 0xa8be;
pascal void PaintArc() = 0xa8bf;
pascal void EraseArc() = 0xa8c0;
pascal void InvertArc() = 0xa8c1;
pascal void FillArc() = 0xa8c2;
char * GetMaskTable();
pascal void CopyMask() = 0xa817;
pascal void MeasureText() = 0xa837;
pascal void CalcMask() = 0xa838;
pascal void SeedFill() = 0xa839;
#endif
char *ctop();
char *ptoc();
#define pass(x) (*((long *)&(x)))
/* KEVIN added for color quickdraw compatibility */
struct RGBColor {
short red;
short green;
short blue;
};
typedef struct RGBColor RGBColor;
struct PixMap {
Ptr baseAddr; /*pointer to pixels*/
short rowBytes; /*offset to next line*/
Rect bounds; /*encloses bitmap*/
short pmVersion; /*pixMap version number*/
short packType; /*defines packing format*/
long packSize; /*length of pixel data*/
Fixed hRes; /*horiz. resolution (ppi)*/
Fixed vRes; /*vert. resolution (ppi)*/
short pixelType; /*defines pixel type*/
short pixelSize; /*# bits in pixel*/
short cmpCount; /*# components in pixel*/
short cmpSize; /*# bits per component*/
long planeBytes; /*offset to next plane*/
Handle pmTable; /* CTabHandle color map for this pixMap*/
long pmReserved; /*for future use. MUST BE 0*/
};
typedef struct PixMap PixMap;
typedef PixMap *PixMapPtr, **PixMapHandle;
struct GDevice {
short gdRefNum; /*driver's unit number*/
short gdID; /*client ID for search procs*/
short gdType; /*fixed/CLUT/direct*/
Handle gdITable; /* ITabHandle Handle to inverse lookup table*/
short gdResPref; /*preferred resolution of GDITable*/
Handle gdSearchProc; /* SProcHndl search proc list head*/
Handle gdCompProc; /* CProcHndl complement proc list*/
short gdFlags; /*grafDevice flags word*/
PixMapHandle gdPMap; /*describing pixMap*/
long gdRefCon; /*reference value*/
Handle gdNextGD; /*GDHandle Handle of next gDevice*/
Rect gdRect; /* device's bounds in global coordinates*/
long gdMode; /*device's current mode*/
short gdCCBytes; /*depth of expanded cursor data*/
short gdCCDepth; /*depth of expanded cursor data*/
Handle gdCCXData; /*Handle to cursor's expanded data*/
Handle gdCCXMask; /*Handle to cursor's expanded mask*/
long gdReserved; /*future use. MUST BE 0*/
};
typedef struct GDevice GDevice;
typedef GDevice *GDPtr, **GDHandle;
#define clutType 0 /*0 if lookup table*/
#define fixedType 1 /*1 if fixed table*/
#define directType 2 /*2 if direct values*/
#define gdDevType 0 /*0 = monochrome 1 = color*/
#define ramInit 10 /*1 if initialized from 'scrn' resource*/
#define mainScreen 11 /* 1 if main screen */
#define allInit 12 /* 1 if all devices initialized */
#define screenDevice 13 /*1 if screen device [not used]*/
#define noDriver 14 /* 1 if no driver for this GDevice */
#define screenActive 15 /*1 if in use*/
#define hiliteBit 7 /*flag bit in HiliteMode (lowMem flag)*/
#define pHiliteBit 0 /*flag bit in HiliteMode used with BitClr procedure*/
#define defQDColors 127 /*resource ID of clut for default QDColors*/
pascal Handle GetGDevice() = 0xaa32;
pascal Handle GetDeviceList() = 0xaa29;
pascal Handle GetNextDevice() = 0xaa2b;
pascal Handle TestDeviceAttribute() = 0xaa2c;
pascal void RGBForeColor() = 0xaa14;
pascal void RGBBackColor() = 0xaa15;
pascal void GetForeColor() = 0xaa19;
pascal void GetBackColor() = 0xaa1a;
pascal void PmForeColor() = 0xaa1a;
pascal void PmBackColor() = 0xaa1a;
pascal long Color2Index() = 0xaa33;
pascal void Index2Color() = 0xaa34;
pascal Boolean getcolor() = 0xA82E;
/* bogus entry ... */
/* added osutil defs ...
pascal void SwapMMUMode() = 0xa05d;
natch, it's OS so it's NOT a pascal routine... */
#define false32b 0
#define true32b 1
#define _QUICKDRAW
#endif